package com.atguigu.eduservice.client;

import com.atguigu.commonutils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component  //交给spring管理
@FeignClient(name = "service-vod", fallback = VodClientImpl.class)  //容错发生时调用fallback里面的类的方法
public interface VodClient {

    //定义调用方法路径
    //删除阿里云端的视频
    /**
     * 特别注意：PathVariable中一定要起一个名称 不然会报错！！！！
     * */
    @DeleteMapping("/vod/video/{videoId}")
    public R deleteVideo(@PathVariable("videoId") String videoId);

    //3  删除多个阿里云端视频
    //参数是多个视频id
    @DeleteMapping("/vod/video/delete-batch")
    public R deleteBatch(@RequestParam("videoIdList") List<String> videoIdList);
}
